Form_UserInserting = function(){
	var obj = this;
	var uploader = new Ext.form.TextField({
		fieldLabel: "文件",
		xtype : "textfield",
		name : "file",
		inputType : "file",
		allowBlank : false
	});
	var fieldSet = new Ext.form.FieldSet({
        border: false,
		autoHeight: true,
		items : [uploader]
	});
	Form_UserInserting.superclass.constructor.call(this, {
		fileUpload: true,
		autoHeight: true,
		bodyStyle: "padding: 5px 5px 0",
		items : [fieldSet],
		buttons : [{
			text : "上传",
			handler : function(){
				if (obj.getForm().isValid()){
					obj.getForm().submit({
						url : "/manage/addUsersByFile",
						waitMsg : "上传中 ...",
						success : function(form, response){
							var data = Ext.util.JSON.decode(response.response.responseText);
							Ext.Msg.alert("上传成功", data.msg);
						},
						failure : function(form, response){
							var data = Ext.util.JSON.decode(response.response.responseText);
							Ext.Msg.alert("上传失败", data.msg);
						}
					});
				}
			}
		}]
    });
}

Ext.extend(Form_UserInserting, Ext.form.FormPanel, {
});

Ext.reg("App.UserManagement.Inserting", Form_UserInserting);